//
//  ChartSocketController.h
//  Chart
//
//  Created by caojun on 14/12/1.
//
//

#import "ChartSocketEnum.h"
#import "YSSecurities.h"
#import "CJQuoteList.h"
#import "ChartSocketDelegate.h"

#import "ChartSocketControllerDelegate.h"


@class CommonSocket;

@interface CJTask : NSObject {
};

@property (nonatomic, strong) NSString *key;
@property (nonatomic, strong) NSString *method;
@property (nonatomic, strong) NSString *parameter;

- (BOOL)isEqualWithTask:(CJTask *)task;

+ (instancetype)taskWithKey:(NSString *)key withMethod:(NSString *)method withParameters:(NSString *)para ;

@end


@interface ChartSocketController : NSObject


@property (nonatomic, strong) CommonSocket *socket;

@property (nonatomic, copy) NSArray *optionalQuotes; //自选列表

/** 列表 */
@property (nonatomic, strong, readonly) NSMutableArray *taskList;

/** 行情列表 */
@property (nonatomic, strong) CJQuoteList *quoteList;

/** 连接状态 */
@property (nonatomic, assign) ChartSocketConnectionStatus status;

/** 取消监听某个值 */
- (void)unsubscribeWithID:(NSString *)metalID;

/** 监听某个值 */
- (void)subscribeWithID:(NSString *)metalID;

/** socket连接 */
- (void)connect;

/** socket 断开连接 */
- (void)disconnect;

/** socket 重新连接 */
- (void)reconnect;

@end
